/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  Navigator,
  Image,
} from 'react-native';
import TabNavigator from 'react-native-tab-navigator';
import Boy from "./js/Boy"
import FetchText from "./js/FetchText";
import ListView2 from './js/ListView'
import Popularpage from './js/pages/Popularpage'
import Setup from './js/pages/Setup';
export default class unionreact extends Component {
  constructor(props){
    super(props);
    this.state ={
      selectedTab: "profile",
    }
  }
  render() {
    return (
      <View style={styles.container}>
        {/*<TabNavigator>*/}
          {/*<TabNavigator.Item*/}
            {/*selected={this.state.selectedTab === 'profile'}*/}
            {/*title="Profile"*/}
            {/*selectedTitleStyle={{color:'red'}}*/}
            {/*renderIcon={() => <Image style={styles.image} source={require("./res/images/ic_trending.png")} />}*/}
            {/*renderSelectedIcon={() => <Image style={[styles.image,{tintColor:'red'}]} source={require("./res/images/ic_trending.png")} />}*/}
            {/*onPress={() => this.setState({ selectedTab: 'profile' })}>*/}
            {/*<View style = {styles.page2}></View>*/}
          {/*</TabNavigator.Item>*/}
          {/*<TabNavigator.Item*/}
            {/*selected={this.state.selectedTab === 'home'}*/}
            {/*title="Home"*/}
            {/*selectedTitleStyle={{color:'green'}}*/}
            {/*renderIcon={() => <Image style={styles.image} source={require("./res/images/ic_polular.png")} />}*/}
            {/*renderSelectedIcon={() => <Image style={[styles.image,{tintColor:"green"}]} source={require("./res/images/ic_polular.png")} />}*/}
            {/*badgeText="1"*/}
            {/*onPress={() => this.setState({ selectedTab: 'home' })}>*/}
            {/*<View style = {styles.page1}></View>*/}
          {/*</TabNavigator.Item>*/}
          {/*<TabNavigator.Item*/}
            {/*selected={this.state.selectedTab === 'news'}*/}
            {/*title="news"*/}
            {/*selectedTitleStyle={{color:'yellow'}}*/}
            {/*renderIcon={() => <Image style={styles.image} source={require("./res/images/ic_favorite.png")} />}*/}
            {/*renderSelectedIcon={() => <Image style={[styles.image,{tintColor:"yellow"}]} source={require("./res/images/ic_favorite.png")} />}*/}
            {/*badgeText="1"*/}
            {/*onPress={() => this.setState({ selectedTab: 'news' })}>*/}
            {/*<View style = {styles.page3}></View>*/}
          {/*</TabNavigator.Item>*/}
        {/*</TabNavigator>*/}

        <Navigator
          initialRoute = {{
            component: Popularpage
          }}
          renderScene = {(route,navigator) =>{
            let Component = route.component;
            return <Component navigator = {navigator} {...route.params}/>
          }}
        ></Navigator>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#F5FCFF',
  },
  image:{
    height:22,
    width:22
  },
  page1:{
    flex:1,
    backgroundColor:'blue'
  },
  page2:{
    flex:1,
    backgroundColor:'yellow'
  },
  page3:{
    flex:1,
    backgroundColor:"red"
  }
});

AppRegistry.registerComponent('unionreact', () => Setup);
